package homework.test1;

import java.util.concurrent.FutureTask;

/*
分别使用三种方式创建线程
 */
public class Demo1 {
    public static void main(String[] args) {
        //方法一
        MyThread t1 = new MyThread();
        t1.start();

        //方法二
        MyRunnable mr = new MyRunnable();
        Thread t2 = new Thread(mr);
        t2.start();

        //方法三
        MyCallable mc = new MyCallable();
        FutureTask<String> ft = new FutureTask<>(mc);
        Thread t3 = new Thread(ft);
        t3.start();
    }
}
